<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MIDI轨道播放器</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div class="container">
        <h1>MIDI轨道播放器</h1>
        <p>选择MIDI文件并发送指定轨道数据到STM32设备</p>

        <div class="control-panel">
            <div class="file-selector">
                <input type="file" id="midiFile" accept=".mid,.midi">
                <button id="selectFileBtn">选择MIDI文件</button>
            </div>

            <div class="track-selector">
                <label for="trackSelect">选择轨道:</label>
                <select id="trackSelect" disabled>
                    <option value="">请先选择文件</option>
                </select>
            </div>

            <div class="serial-controls">
                <button id="connectBtn">连接串口</button>
                <select id="baudRateSelect">
                    <option value="9600">9600</option>
                    <option value="19200">19200</option>
                    <option value="38400">38400</option>
                    <option value="57600">57600</option>
                    <option value="115200" selected>115200</option>
                </select>
                <button id="playBtn" disabled>播放轨道</button>
                <button id="stopBtn" disabled>停止播放</button>
            </div>

            <div class="status">
                <p id="statusText">准备就绪</p>
            </div>
        </div>

        <div class="track-info">
            <h3>轨道信息</h3>
            <pre id="trackInfo"></pre>
        </div>

        <div class="serial-log">
            <h3>串口日志</h3>
            <pre id="serialLog"></pre>
        </div>
    </div>

    <script src="js/main.js"></script>
</body>
</html>